package com.huawei.codearts.tools.exception;

import com.huawei.codearts.tools.validated.StatusEnum;
import lombok.Getter;

import java.io.Serial;

@Getter
public class CustomException extends RuntimeException {

    @Serial
    private static final long serialVersionUID = -2805284943658356093L;

    private final int code;

    public CustomException(int code, String message) {
        super(message);
        this.code = code;
    }

    public CustomException(String message) {
        this(StatusEnum.ERROR.code, message);
    }

}
